package com.padakeji.android.pworks.content;

import com.google.gson.Gson;

import java.lang.reflect.Type;

/**
 * Created by AtanL on 2015/9/23.
 */
public class GsonWrapper implements JsonWorker {

    private Gson gson;

    public GsonWrapper() {
        gson = new Gson();
    }

    @Override
    public String toJson(Object o) {
        return gson.toJson(o);
    }

    @Override
    public <T> T fromJson(String json, Class<T> c) {
        return gson.fromJson(json, c);
    }

    @Override
    public <T> T fromJson(String json, Type t) {
        return gson.fromJson(json, t);
    }


}
